/**
 * File: MapConfigResource.java
 * Created by: mhaimel
 * Created on: 30 Mar 2009
 * CVS:  $Id: MapConfigResource.java,v 1.1 2009/04/22 07:38:10 mhaimel Exp $
 */
package uk.ac.ebi.velvet.util.config.impl;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import uk.ac.ebi.velvet.util.config.ConfigResource;

/**
 * @author mhaimel
 *
 */
public class MapConfigResource implements ConfigResource {
	
	private Map<Class<?>, Map<Object, Object>> map = new HashMap<Class<?>, Map<Object,Object>>();

	public MapConfigResource() {
		// do nothing
	}	

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Properties getProperties(Class<?> clazz) {
		Properties prop = new Properties();
		Map<Object,Object> subM = map.get(clazz);
		if(null != subM){
			prop.putAll(subM);
		}
		return prop;
	}
	
	public void register(Class<?> clazz,Map<Object,Object> map){
		this.map.put(clazz, map);
	}

}
